﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Admin/Views/Shared/Site.Master"
    Inherits="System.Web.Mvc.ViewPage<IEnumerable<Model.tkntProduct>>" %>

<%@ Import Namespace="UI.Helper" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Kết quả tìm kiếm
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <!--  start page-heading -->
    <div id="page-heading">
        <h1>
            Kết Quả Tìm Kiếm Sản Phẩm</h1>
    </div>
    <!-- end page-heading -->
    <table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
        <tr>
            <th rowspan="3" class="sized">
                <img src="<%= Utils.ResolveUrl(this.Html, "~/") %>images/admin/shared/side_shadowleft.jpg"
                    width="20" height="300" alt="" />
            </th>
            <th class="topleft">
            </th>
            <td id="tbl-border-top">
                &nbsp;
            </td>
            <th class="topright">
            </th>
            <th rowspan="3" class="sized">
                <img src="<%= Utils.ResolveUrl(this.Html, "~/") %>images/admin/shared/side_shadowright.jpg"
                    width="20" height="300" alt="" />
            </th>
        </tr>
        <tr>
            <td id="tbl-border-left">
            </td>
            <td>
                <!--  start content-table-inner ...................................................................... START -->
                <div id="content-table-inner">
                    <!--  start table-content  -->
                    <div id="table-content">
                        <!--  start table ..................................................................................... -->
                        <form id="mainform" action="">
                        <table border="0" width="100%" cellpadding="0" cellspacing="0" id="product-table">
                            <tr>
                                <th class="table-header-check">
                                    <a id="toggle-all"></a>
                                </th>
                                <th class="table-header-repeat line-left minwidth-1">
                                    <label>
                                        Mô tả</label>
                                </th>
                                <th class="table-header-repeat line-left">
                                    <label>
                                        Danh mục</label>
                                </th>
                                <th class="table-header-options line-left">
                                    <label>
                                        Tùy chọn</label>
                                </th>
                            </tr>
                            <% foreach (var tmp in Model)
                               { %>
                            <tr>
                                <td>
                                    <input value="<%: tmp.Id %>" type="checkbox" />
                                </td>
                                <td>
                                    <%: tmp.ViDescription %>
                                </td>
                                <td>
                                    <%: tmp.Category.ViName %>
                                </td>
                                <td class="options-width">
                                    <%: Html.ActionLink(" ", "Edit", new { area = "Admin", controller = "FurnitureProduct", id = tmp.Id }, new { title = "Chỉnh sửa", @class = "icon-1 info-tooltip" })%>
                                    <%: Html.ActionLink(" ", "Delete", new { area = "Admin", controller = "FurnitureProduct", id = tmp.Id }, new { title = "Xóa", @class = "icon-2 info-tooltip", onclick = "return ConfirmDelete();" })%>
                                    <%: Html.ActionLink(" ", "Index", new { area = "Admin", controller = "FurnitureImage", id = tmp.Id }, new { title = "Hình ảnh", @class = "icon-3 info-tooltip" })%>
                                    <%--<a href="" title="Edit" class="icon-1 info-tooltip"></a>
					            <a href="" title="Delete" class="icon-2 info-tooltip"></a>
					            <a href="" title="Edit" class="icon-3 info-tooltip"></a>
					            <a href="" title="Edit" class="icon-4 info-tooltip"></a>
					            <a href="" title="Edit" class="icon-5 info-tooltip"></a>--%>
                                </td>
                            </tr>
                            <% } %>
                        </table>
                        </form>
                    </div>
                    <!--  end content-table  -->
                    <!--  start actions-box ............................................... -->
                    <div id="actions-box">
                        <a href="" class="action-slider"></a>
                        <div id="actions-box-slider">
                            <%: Html.ActionLink("Thêm", "Add", new { area = "Admin", controller = "FurnitureProduct" }, new { @class = "action-edit" })%>
                            <%: Html.ActionLink("Xóa", "DeleteAll", new { area = "Admin", controller = "FurnitureProduct" }, new { @class = "action-delete", onclick = "return SubmitDelete(this);" })%>
                        </div>
                        <div class="clear">
                        </div>
                    </div>
                    <!-- end actions-box........... -->
                    <div class="clear">
                    </div>
                </div>
            </td>
            <td id="tbl-border-right">
            </td>
        </tr>
        <tr>
            <th class="sized bottomleft">
            </th>
            <td id="tbl-border-bottom">
                &nbsp;
            </td>
            <th class="sized bottomright">
            </th>
        </tr>
    </table>
    <script type="text/javascript">
        function ConfirmDelete() {
            var res = confirm("Bạn muốn xóa dữ liệu này?");

            return res;
        }

        function SubmitDelete(obj) {
            var ids = "";
            $(".ui-helper-hidden-accessible").each(function () {
                if (ids == "")
                    ids += this.value;
                else
                    ids += "," + this.value;
            });

            if (ids == "") {
                alert("Vui lòng chọn dữ liệu cần xóa.");
            }
            else
                location.href = obj.href + "/" + ids;
            return false;
        }
    </script>
</asp:Content>